package com.meritdata.cloud.data.service.development.model; /***********************************************************************
 * Module:  TD_DATA_API_TABLE.java
 * Author:  Lenovo
 * Purpose: Defines the Class TD_DATA_API_TABLE
 ***********************************************************************/

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/** 数据服务Table */
@Entity
@Table(name = "TD_DATA_API_TABLE")
public class TdDataApiTable {
	/** ID:ID */
	@Id
	@GeneratedValue
	private Long id;
	/** 服务ID:API_ID */
	@Column(name="API_ID")
	private Long apiId;
	/** 表元数据ID:TABLE_ID */
	@Column(name="TABLE_ID")
	private Long tableId;
	/**
	 * 存储where条件后的语句
	 *
	 * 查询条件JSON:CONTENT
	 *{
	 *  relation: 'and',
	 *  conditions: [{
	 *   relation: 'and',
	 *   conditions: [{
	 *    column:  {
	 *     name: 'col1',
	 *     title: "列1",
	 *     type: 'string'
	 *    },
	 *    operator: '=',
	 *    value: {
	 *     type: "param",
	 *     text: param1",
	 *    }
	 *   },{
	 *    relation: 'or',
	 *    conditions: [{
	 *     column:  {
	 * 		name: 'col2',
	 * 		title: "列2",
	 * 		type: 'string'
	 *     },
	 *     operator: 'is null',
	 *     value: {}
	 *    }]
	 *   },{
	 *    column:  {
	 *     name: 'col4',
	 *     title: "列4",
	 *     type: 'string'
	 *    },
	 *    operator: '=',
	 *    value: {
	 *     type: "value",
	 *     text: "陕西",
	 *    }
	 *   }]
	 *  }]
	 * }
	 *
	 * where (col1 = param1 or (col2 is NULL) and col4 = '陕西')
	 *
	 */
	@Column(name="CONTENT")
	private String content;
	/**
	 * 存储order by 条件后的语句
	 *
	 * 排序条件JSON:ORDER_BY
	 * [{
	 * 	cloumn: {
	 * 		name: 'col1',
	 * 		title: "列1",
	 * 		type: 'string'
	 *              },
	 * 	sort:asc
	 * },
	 * {
	 * 	cloumn:{
	 * 		name: 'col2',
	 * 		title: "列2",
	 * 		type: 'string'
	 *       }
	 * 	sort:desc
	 * },{
	 * 	cloumn:{
	 * 		name: 'col3',
	 * 		title: "列3",
	 * 		type: 'string'
	 *       }
	 * 	sort:asc
	 * }]
	 *eq:等于,neq:不相等,gt:大于,lt:小于,goe:大于等于,loe:小于等于,isnull:为空
	 * order by clo1 asc,clo2 desc ,clo3 asc
	 */
	@Column(name="ORDER_BY")
	private String orderBy;
	/** 创建时间:CREATE_TIME */
	@Column(name="CREATE_TIME")
	private Date createTime;
	/** 修改时间:UPDATE_TIME */
	@Column(name="UPDATE_TIME")
	private Date updateTime;
	/** 创建人ID:CREATOR */
	@Column(name="CREATOR")
	private Long creator;
	/** 修改人ID:REVISER_ID */
	@Column(name="REVISER_ID")
	private Long reviserId;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getApiId() {
		return apiId;
	}
	public void setApiId(Long apiId) {
		this.apiId = apiId;
	}
	public Long getTableId() {
		return tableId;
	}
	public void setTableId(Long tableId) {
		this.tableId = tableId;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getOrderBy() {
		return orderBy;
	}
	public void setOrderBy(String orderBy) {
		this.orderBy = orderBy;
	}

	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Long getCreator() {
		return creator;
	}
	public void setCreator(Long creator) {
		this.creator = creator;
	}
}